package com.nit.store.util;

import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.impl.DefaultMapperFactory;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @Author J1ay
 * @Date 2022/7/21 19:18
 * @Description
 */

public class CommonUtils {
    /**
     * <p>
     * 返回一个DefaultMapperFactory的build对象，主要用来实现entity与dto的转换
     * 使用举例：CommonUtil.getMapperFactory().getMapperFacade().map(实例对象，目标类.class)
     * 实际上build对象还有很多方法，可以根据百度学习
     * @return : ma.glasnost.orika.impl.DefaultMapperFactory
     */
    public static DefaultMapperFactory getMapperFactory(){
        return new DefaultMapperFactory.Builder().build();
    }

    public static MapperFacade getMapperFacade() {
        return getMapperFactory().getMapperFacade();
    }





}
